<?php

/* 路由文件 */
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

/* 
 管理后台api
 prefix 前缀，middleware 中间件 
*/
Route::group(['prefix' => '/Api/admin'], function () {
    Route::post('login', 'App\Http\Controllers\SysUserController@login');  //登录
    Route::post('logout', 'App\Http\Controllers\SysUserController@logout');  //退出登录

    Route::get('menu', 'App\Http\Controllers\MenuController@menu');  //获取当前登录人员所拥有的菜单权限
    //获取系统所有的菜单列表及动作权限 用于添加和修改角色信息时，确定角色的菜单权限
    Route::get('sys_menu_list', 'App\Http\Controllers\MenuController@sys_menu_list');
    Route::get('menu/action_by_path', 'App\Http\Controllers\MenuController@action_by_path');//根据路径获取动作权限

    //用户相关api
    Route::get('user/list', 'App\Http\Controllers\SysUserController@list');  //获取用户列表
    Route::post('user/insert', 'App\Http\Controllers\SysUserController@insert');  //添加用户
    Route::post('user/delete', 'App\Http\Controllers\SysUserController@delete');  //删除用户
    Route::post('user/update', 'App\Http\Controllers\SysUserController@update');  //修改用户
    Route::get('user/detail', 'App\Http\Controllers\SysUserController@detail');   //获取用户详情

    //角色相关api
    Route::get('role/list', 'App\Http\Controllers\SysRoleController@list');         //获取角色列表
    Route::post('role/insert', 'App\Http\Controllers\SysRoleController@insert');    //添加角色
    Route::post('role/delete', 'App\Http\Controllers\SysRoleController@delete');    //删除角色
    Route::post('role/update', 'App\Http\Controllers\SysRoleController@update');    //修改角色
    Route::get('role/detail', 'App\Http\Controllers\SysRoleController@detail');     //获取角色详情

    //预约记录相关api
    Route::get('reservation/personal_list', 'App\Http\Controllers\ReservationRecordController@personal_list');  //个人预约记录列表
    Route::get('reservation/personal_detail', 'App\Http\Controllers\ReservationRecordController@personal_detail'); //详情

    Route::get('reservation/team_list', 'App\Http\Controllers\ReservationRecordController@team_list');     //团队预约记录列表
    Route::post('reservation/team_update', 'App\Http\Controllers\ReservationRecordController@team_update');//修改团队预约记录
    Route::get('reservation/team_detail', 'App\Http\Controllers\ReservationRecordController@team_detail'); //团队预约记录详情

    Route::get('reservation/activity_list', 'App\Http\Controllers\ReservationRecordController@activity_list');     //活动列表
    Route::post('reservation/activity_update', 'App\Http\Controllers\ReservationRecordController@activity_update');//审核活动申请
    Route::get('reservation/activity_detail', 'App\Http\Controllers\ReservationRecordController@activity_detail'); //详情

    //预约设置相关api
    Route::get('reservation_set/list', 'App\Http\Controllers\ReservationSetController@list');         //获取预约设置列表
    Route::post('reservation_set/insert', 'App\Http\Controllers\ReservationSetController@insert');    //添加预约设置
    Route::post('reservation_set/delete', 'App\Http\Controllers\ReservationSetController@delete');    //删除预约设置
    Route::post('reservation_set/update', 'App\Http\Controllers\ReservationSetController@update');    //修改预约设置
    Route::get('reservation_set/detail', 'App\Http\Controllers\ReservationSetController@detail');     //获取预约设置详情

    //临时闭馆相关api
    Route::get('temporary_close/list', 'App\Http\Controllers\TemporaryCloseController@list');         //获取临时闭馆列表
    Route::post('temporary_close/insert', 'App\Http\Controllers\TemporaryCloseController@insert');    //添加临时闭馆
    Route::post('temporary_close/delete', 'App\Http\Controllers\TemporaryCloseController@delete');    //删除临时闭馆
    Route::post('temporary_close/update', 'App\Http\Controllers\TemporaryCloseController@update');    //修改临时闭馆
    Route::get('temporary_close/detail', 'App\Http\Controllers\TemporaryCloseController@detail');     //获取临时闭馆详情

    //篇章管理相关api
    Route::get('exhibit_one/list', 'App\Http\Controllers\ExhibitOneController@list');         //获取列表
    Route::get('exhibit_one/no_page_list', 'App\Http\Controllers\ExhibitOneController@no_page_list');
    Route::post('exhibit_one/insert', 'App\Http\Controllers\ExhibitOneController@insert');    //添加
    Route::post('exhibit_one/delete', 'App\Http\Controllers\ExhibitOneController@delete');    //删除
    Route::post('exhibit_one/update', 'App\Http\Controllers\ExhibitOneController@update');    //修改
    Route::post('exhibit_one/delete_item', 'App\Http\Controllers\ExhibitOneController@delete_item');//删除多媒体文件
    Route::get('exhibit_one/detail', 'App\Http\Controllers\ExhibitOneController@detail');     //获取详情
    Route::get('exhibit_one/get_exhibit_list', 'App\Http\Controllers\ExhibitOneController@get_exhibit_list');//提供给小程序的接口，查询各级展项列表

    //展项管理相关api
    Route::get('exhibit_two/list', 'App\Http\Controllers\ExhibitTwoController@list');         //获取列表
    Route::get('exhibit_two/mini_list', 'App\Http\Controllers\ExhibitTwoController@mini_list');         //获取列表
    Route::get('exhibit_two/no_page_list', 'App\Http\Controllers\ExhibitTwoController@no_page_list');
    Route::post('exhibit_two/insert', 'App\Http\Controllers\ExhibitTwoController@insert');    //添加
    Route::post('exhibit_two/delete', 'App\Http\Controllers\ExhibitTwoController@delete');    //删除
    Route::post('exhibit_two/update', 'App\Http\Controllers\ExhibitTwoController@update');    //修改
    Route::get('exhibit_two/detail', 'App\Http\Controllers\ExhibitTwoController@detail');     //获取详情

    //展品管理相关api
    Route::get('exhibit_three/list', 'App\Http\Controllers\ExhibitThreeController@list');         //获取列表
    Route::post('exhibit_three/insert', 'App\Http\Controllers\ExhibitThreeController@insert');    //添加
    Route::post('exhibit_three/delete', 'App\Http\Controllers\ExhibitThreeController@delete');    //删除
    Route::post('exhibit_three/update', 'App\Http\Controllers\ExhibitThreeController@update');    //修改
    Route::get('exhibit_three/detail', 'App\Http\Controllers\ExhibitThreeController@detail');     //获取详情
    Route::get('exhibit_three/mini_list', 'App\Http\Controllers\ExhibitThreeController@mini_list');

    //公告相关api
    Route::get('notice/list', 'App\Http\Controllers\NoticeController@list');         //获取公告列表
    Route::post('notice/insert', 'App\Http\Controllers\NoticeController@insert');    //添加公告
    Route::post('notice/delete', 'App\Http\Controllers\NoticeController@delete');    //删除公告
    Route::post('notice/update', 'App\Http\Controllers\NoticeController@update');    //修改公告
    Route::get('notice/detail', 'App\Http\Controllers\NoticeController@detail');     //获取公告详情

    //参观者相关api
    Route::get('visitor/list', 'App\Http\Controllers\VisitorController@list');         //获取参观者列表
    Route::get('visitor/detail', 'App\Http\Controllers\VisitorController@detail');     //获取参观者详情

    //提醒文本相关api
    Route::post('reminder/update', 'App\Http\Controllers\ReminderController@update'); //修改提醒文本
    Route::get('reminder/detail', 'App\Http\Controllers\ReminderController@detail'); //获取提醒文本
    

    //文件相关api
    Route::post('file/upload', 'App\Http\Controllers\FileController@upload');     //文件上传
    Route::post('file/delete', 'App\Http\Controllers\FileController@delete');     //文件删除


    Route::get('date_slot/generate', 'App\Http\Controllers\DateSlotController@generate'); //生成具体的可预约日期和时间段

});


/* 小程序api */
Route::group(['prefix' => '/Api/MiniProgram'], function () {
    Route::post('login', 'App\Http\Controllers\MiniUserController@login');  //登录

});

